package cn.com.open.opensaas.answerservice.mapper;

import cn.com.open.opensaas.baiscommon.model.question.QuestionContent;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface QuestionContentMapper {
	/**
	 * 根据Id查询试题
	 * @param questionId
	 * @return
	 */
//	@Select("select * from QuestionContent where QuestionID = #{questionId}")
//	public QuestionContent findQuestionById(@Param("questionId") String questionId);

	/**
	 * 根据Ids批量查询试题
	 * @param questionIds
	 * @return
	 */
	@Select("<script>" +
			"select QuestionID questionId,ContentJson contentJson  from QuestionContent where QuestionID in\n" +
			" (\n" +
			" <foreach collection=\"list\" item=\"item\" index=\"index\" separator=\",\">\n" +
			" #{item}\n" +
			" </foreach>\n" +
			" )" +
			"</script>")
	List<QuestionContent> findDBQuestionByIds(@Param("list") List questionIds);
}